// ====================================================================
//  The Main Menu
//
//  (c) 2003, Epic Games, Inc.  All Rights Reserved
//  Updated by Ron Prestenback
// ====================================================================

class EnyaraMainMenu extends UT2K4GUIPage;


var automated   GUIButton   b_Play, b_Settings, b_Quit;
var automated   GUILabel    lb_Devs;
var localized   string      Devs;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
	Super.InitComponent(MyController, MyOwner);
	MyController.bModAuthor = true;
	MyController.SaveConfig();
	lb_Devs.Caption = Devs;
}

function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
{
	if(Key == 0x1B)
	{
		Controller.OpenMenu(Controller.GetQuitPage());
		return true;
	}

	return false;
}

function bool ButtonClick(GUIComponent Sender)
{
	if (Sender == b_Play)
	{
		//Controller.LastGameType = "Enyara.Enyara";
		Console(Controller.Master.Console).DelayedConsoleCommand("open EY-LevelOne");
		Controller.CloseAll(false,True);
	}
	else if (Sender == b_Settings){
		Controller.OpenMenu(Controller.GetSettingsPage());
    }
	else if (Sender == b_Quit){
		Controller.OpenMenu(Controller.GetQuitPage());
    }
	return true;
}


defaultproperties
{

	Begin Object class=GUILabel name=lbDevs
		WinWidth=1
		WinLeft=0
		WinTop=0.95
		Caption="Game Developers"
		TextColor=(R=180,G=0,B=0)
	End Object

	Begin Object Class=GUIButton Name=bPlay
		FontScale=FNS_Small
		StyleName="TextButton"
		Caption="Play Enyara"
		CaptionEffectStylename="TextButtonEffect"
		CaptionAlign=TXTA_Left
		Hint="Play Enyara"
		OnClick=ButtonClick
		//WinWidth=0.574135
		WinHeight=0.075000
		//WinLeft=0.433406
		//WinTop=0.705859
		WinTop=0.29
		WinLeft=0.33
		WinWidth=0.28
		bFocusOnWatch=true
		TabOrder=4
		bUseCaptionHeight=true
	End Object

	Begin Object Class=GUIButton Name=SettingsButton
		FontScale=FNS_Small
		StyleName="TextButton"
		Caption="Settings"
		CaptionEffectStylename="TextButtonEffect"
		CaptionAlign=TXTA_Left
		Hint="Change your controls and settings"
		OnClick=ButtonClick
		//WinWidth=0.580478
		WinHeight=0.075000
		//WinLeft=0.434477
		//WinTop=0.800327
		WinTop=0.62
		WinWidth=0.2
		WinLeft=0.15
		bFocusOnWatch=true
		TabOrder=5
		bUseCaptionHeight=true
	End Object

	Begin Object Class=GUIButton Name=QuitButton
		FontScale=FNS_Small
		StyleName="TextButton"
		Caption="Exit Enyara"
		CaptionEffectStylename="TextButtonEffect"
		CaptionAlign=TXTA_Left
		Hint="Exit Enyara"
		OnClick=ButtonClick
		//WinWidth=0.526767
		WinHeight=0.075000
		//WinLeft=0.424711
		//WinTop=0.887567
		WinTop=0.62
		WinLeft=0.55
		WinWidth=0.26
		bFocusOnWatch=true
		TabOrder=6
		bUseCaptionHeight=true
	End Object

	b_Settings=SettingsButton
	b_Play=bPlay
	b_Quit=QuitButton
	lb_Devs=lbDevs;

	WinWidth=1.0
	WinHeight=1.0
	WinTop=0.0
	WinLeft=0.0

	bRenderWorld=False
	bAllowedAsLast=true
	bDisconnectOnOpen=true
	Devs="Developed by: Tim Bennett, Brian Block, Ryan Davis, Kevin Herndon, Andrew Kerr, Patrick Lentz, and Josh Singley"

    Background=Texture'EnyaraTextures.loading.EnyaraLogo'

	OnKeyEvent=EnyaraMainMenu.InternalOnKeyEvent
}
